<template>
  <el-dialog
    v-model="addDialogVisible"
    title="添加成员"
    width="600px"
    class="add-dialog-box-coupon"
    :before-close="CancelFUnc"
  >
    <el-form :model="addForm" label-width="100px" label-position="left">
      <el-form-item label="姓名">
        <el-input class="add-input-box" v-model="addForm.name" />
      </el-form-item>
      <el-form-item label="手机号">
        <el-input class="add-input-box" v-model="addForm.name" />
      </el-form-item>
      <el-form-item label="密码">
        <el-input class="add-input-box" v-model="addForm.name" />
      </el-form-item>
      <el-form-item label="身份">
        <el-select
          v-model="addForm.value"
          placeholder="请选择身份"
          class="add-input-box"
        >
          <el-option
            v-for="item in options_"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="分成比例">
        <el-input
          class="add-input-box2"
          v-model="addForm.name"
          v-inputLimt="0"
        />
        <span class="unit-box">%</span>
      </el-form-item>
      <el-form-item label="订单图款">
        <el-radio-group v-model="addForm.radio">
          <el-radio :label="1">允许</el-radio>
          <el-radio :label="2">不允许</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="登录权限">
        <el-radio-group v-model="addForm.radio">
          <el-radio :label="1">允许</el-radio>
          <el-radio :label="2">不允许</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="提现方式">
        <el-radio-group v-model="addForm.radio">
          <el-radio :label="1">自动提现</el-radio>
          <el-radio :label="2">手动提现</el-radio>
          <el-radio :label="3">冻结30天</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="提现权限">
        <el-radio-group v-model="addForm.radio">
          <el-radio :label="1">允许</el-radio>
          <el-radio :label="2">不允许</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button class="btn-cancel" @click="CancelFUnc">取消</el-button>
        <el-button
          type="primary"
          @click="addDialogVisible = false"
          class="btn-submit"
        >
          确定
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import {
  computed,
  watch,
  onMounted,
  getCurrentInstance,
  ref,
  defineEmits,
  nextTick,
} from 'vue'
const { proxy: that } = getCurrentInstance()
const props = defineProps({
  show: {
    type: Boolean,
    default: () => {
      return false
    },
  },
  tableData: {
    type: Array,
    default: () => {
      return []
    },
  },
})

let addDialogVisible = ref(false)
let addForm = ref({
  radio: 1,
})
const shortcuts = [
  {
    text: '最近一周',
    value: () => {
      const end = new Date()
      const start = new Date()
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
      return [start, end]
    },
  },
  {
    text: '最近一个月',
    value: () => {
      const end = new Date()
      const start = new Date()
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
      return [start, end]
    },
  },
  {
    text: '最近三个月',
    value: () => {
      const end = new Date()
      const start = new Date()
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
      return [start, end]
    },
  },
]
const options_ = [
  {
    value: 'guide',
    label: 'Guide',
    children: [
      {
        value: 'disciplines',
        label: 'Disciplines',
        children: [
          {
            value: 'consistency',
            label: 'Consistency',
          },
          {
            value: 'feedback',
            label: 'Feedback',
          },
          {
            value: 'efficiency',
            label: 'Efficiency',
          },
          {
            value: 'controllability',
            label: 'Controllability',
          },
        ],
      },
      {
        value: 'navigation',
        label: 'Navigation',
        children: [
          {
            value: 'side nav',
            label: 'Side Navigation',
          },
          {
            value: 'top nav',
            label: 'Top Navigation',
          },
        ],
      },
    ],
  },
]
watch(
  () => props.show,
  (newValue, oldValue) => {
    addDialogVisible.value = props.show
  }
)
const emit = defineEmits(['onClose'])
const CancelFUnc = () => {
  emit('onClose', false)
}
const SubmitFUnc = () => {}
</script>
<style lang="scss">
@import './store_dislog.scss';
</style>